package cn.iocoder.yudao.module.famous.doctor.controller.app.diseaseLabel;

import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.module.famous.doctor.controller.admin.diseaseLabel.vo.*;
import cn.iocoder.yudao.module.famous.doctor.dal.dataobject.diseaseLabel.DiseaseLabelDO;
import cn.iocoder.yudao.module.famous.doctor.convert.diseaseLabel.DiseaseLabelConvert;
import cn.iocoder.yudao.module.famous.doctor.service.diseaseLabel.DiseaseLabelService;

@Tag(name = "用户 APP - 疾病标签")
@RestController
@RequestMapping("/famous.doctor/disease-label")
@Validated
public class AppDiseaseLabelController {

    @Resource
    private DiseaseLabelService diseaseLabelService;


    @GetMapping("/listAll")
    @Operation(summary = "获得疾病标签列表")
    public CommonResult<List<DiseaseLabelRespVO>> listAll() {
        List<DiseaseLabelDO> list = diseaseLabelService.getDiseaseLabelList();
        list.sort(Comparator.comparing(DiseaseLabelDO::getSort));
        return success(DiseaseLabelConvert.INSTANCE.convertList(list));
    }


}
